Check for the cups function httpGetAuthString().
authorMatthias Clasen <mclasen@redhat.com>
Fri, 7 Sep 2007 18:32:36 +0000 (18:32 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 7 Sep 2007 18:32:36 +0000 (18:32 +0000)
2007-09-07  Matthias Clasen  <mclasen@redhat.com>

        * configure.in: Check for the cups function httpGetAuthString().

        * modules/printbackends/cups/gtkcupsutils.c: Use httpGetAuthString()
        if available.  (#467414, Claudio Saavedra)

svn path=/trunk/; revision=18753

ChangeLog
configure.in
modules/printbackends/cups/gtkcupsutils.c

index fab6466cee615dfe1d820a8f36d9c3d9826915c4..b1af63729f9f983ec503b58ebe9f74f5076b041f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-09-07  Matthias Clasen  <mclasen@redhat.com>
+
+       * configure.in: Check for the cups function httpGetAuthString().
+
+       * modules/printbackends/cups/gtkcupsutils.c: Use httpGetAuthString()
+       if available.  (#467414, Claudio Saavedra)
+
 2007-09-07  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_init),
index cf4491154ca512a35481a0e101a02120c2fb905d..e3337a0f42ab2f2552e47b810d0e6dc239c2bdb2 100644 (file)
@@ -1583,6 +1583,11 @@ CFLAGS="$gtk_save_cflags"
 
 AC_SUBST(HAVE_HTTP_AUTHSTRING)
 
+gtk_save_libs="$LIBS"
+LIBS="$CUPS_LIBS"
+AC_CHECK_FUNCS(httpGetAuthString)
+LIBS="$gtk_save_libs"
+
 gtk_save_cppflags="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS"
                          
index 32d433f1fe9bcbfd5138ee18a24b40325c35004a..8fc76f0b41e8f3a9c2e8ece4bdf744d04db4ebdc 100644 (file)
@@ -629,9 +629,13 @@ _post_send (GtkCupsRequest *request)
        
   httpClearFields (request->http);
   httpSetField (request->http, HTTP_FIELD_CONTENT_LENGTH, length);
-  httpSetField (request->http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
+  httpSetField (request->http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");`
+#ifdef HAVE_HTTPGETAUTHSTRING
+  httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, httpGetAuthString (request->http));
+#else
 #ifdef HAVE_HTTP_AUTHSTRING
   httpSetField (request->http, HTTP_FIELD_AUTHORIZATION, request->http->authstring);
+#endif
 #endif
 
   if (httpPost (request->http, request->resource))